// 判断对象为空对象
function fn1(obj) {
    let keys = [];

    for (let item in obj) {
        keys.push(item);
    };

    return keys.length === 0 ? true : false;
};

function fn2(obj) {
    for (let item in obj) {
        if (item) {
            return false;
        };
    };

    return true;
};


function fn3(obj) {
    return Object.keys(obj).length === 0 ? true : false;
};


function fn4(obj) {
    return JSON.stringify(obj) === '{}' ? true : false;
};

// test
let obj = {};

console.log(fn4(obj))

